package queryingDBs;

import java.io.*;
import java.util.Scanner;

import java.sql.*;

public class pictureQuery {

	
private static java.sql.Connection linktodata () {

        java.sql.Connection conn = null;
        try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                }
        catch (Exception e) {
                return conn;
                }
        try {
                conn = java.sql.DriverManager.getConnection(
                        "jdbc:mysql://bhajee/J850a?user=jtest&password=");
        }
        catch (Exception e) {
                return conn;
                }
        return conn;
}



/*public void query(String dbName, String selector) {
	    java.sql.Connection conn = linktodata();

        StringBuffer reply = new StringBuffer("<table border=1>");

        String todo = ("SELECT * "+
                " from dbName " + selector);

        try {
                java.sql.Statement s = conn.createStatement();
                java.sql.ResultSet r = s.executeQuery (todo);
                while(r.next()) {
                        reply.append("<tr>");
                        for (int i=0;i<fields.length;i++) {
                        reply.append(tabit(r.getString(fields[i])));
                        }
                        reply.append("</tr>");
                        }
                reply.append("</table>");
                }
        catch (Exception e) {
                return ("Oh oops - code 003\n"+e);
                }

        return (reply.toString());

        }*/
	
}
